/**
 * Base event class
 * @type {Object}
 */
Omplus.events.Event = Omplus.base.extend(Omplus.base.Base, {

    init : function(){},

    omplusType : "Event",

    setSender : function(sender){
        this.sender = sender;
    },

    getSender : function(){
        return this.sender;
    },

    attach : function(listener){
        this.listeners.push(listener);
    },

    clear : function(){
        this.listeners = [];
    },

    notify : function(args){
        var index;
        for (index = 0; index < this.listeners.length; index += 1) {
            this.listeners[index](this.sender, args);
        }
    },

    sender : null,

    listeners : []
});

Omplus.events.OnCreateModel = Omplus.base.extend(Omplus.events.Event, {
    omplusType : "OnCreateModel"
});

Omplus.events.OnDestroyModel = Omplus.base.extend(Omplus.events.Event, {
    omplusType : "OnDestroyModel"
});

Omplus.events.OnUpdateModel = Omplus.base.extend(Omplus.events.Event, {
    omplusType : "OnUpdateModel"
});

Omplus.events.OnErrorModel = Omplus.base.extend(Omplus.events.Event, {
    omplusType : "OnErrorModel"
});





Omplus.events.OnCreateView = Omplus.base.extend(Omplus.events.Event, {
    omplusType : "OnCreateView"
});

Omplus.events.OnDestroyView = Omplus.base.extend(Omplus.events.Event, {
    omplusType : "OnDestroyView"
});

Omplus.events.OnUpdateView = Omplus.base.extend(Omplus.events.Event, {
    omplusType : "OnUpdateView"
});




Omplus.events.OnAppendView = Omplus.base.extend(Omplus.events.Event, {
    omplusType: "OnAppendView"
});
